//年月日转时间戳
function getTime(val: string) {
    let d = val + ' 00:00:00'
    let date = new Date(d)
    return date.getTime()
}
//根据时间戳转年月日
const setDate = (value: number) => {
    let date = new Date(value);
    let y: any;
    let m: any;
    let d: any;
    y = date.getFullYear();
    m = date.getMonth() + 1;
    m = m < 10 ? "0" + m : m;
    d = date.getDate();
    d = d < 10 ? "0" + d : d;
    let dates = y + "-" + m + "-" + d;
  
    return dates;
  };
export {getTime,setDate}